package com.aliwo.design.patterns.simpleFactory;


/**
 * @author xuyayuan
 * @description 简单工厂测试
 * @date 2021/9/8 10:21
 */
public class SimpleFactoryTest {
    public static void main(String[] args) {
//        try {
//            TV tv;
//            String brandName = XmlUtil.getBrandName();
//            tv = TVFactory.produceTV(brandName);
//            tv.play();
//        } catch (Exception e) {
//            System.out.println("异常:"+ e);
//        }

        try {
            TV tv = TVFactory.produceTV(XiaoMiProduct.class);
            tv.play();
        } catch (Exception e) {
            System.out.println("异常:"+ e);
        }

    }
}
